<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>暴露的方法 | d2-crud-plus</title>
    <meta name="generator" content="VuePress 1.7.1">
    <link rel="icon" href="/d2-crud-plus/icon-only.png">
    <link rel="manifest" href="/d2-crud-plus/manifest.json">
    <link rel="apple-touch-icon" href="/d2-crud-plus/icons/apple-touch-icon-152x152.png">
    <link rel="mask-icon" href="/d2-crud-plus/icons/safari-pinned-tab.svg" color="#3eaf7c">
    <meta name="description" content="d2-crud-plus doc">
    <meta name="theme-color" content="#3eaf7c">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="msapplication-TileImage" content="/icons/msapplication-icon-144x144.png">
    <meta name="msapplication-TileColor" content="#000000">
    
    <link rel="preload" href="/d2-crud-plus/assets/css/0.styles.04fdeb33.css" as="style"><link rel="preload" href="/d2-crud-plus/assets/js/app.cf559687.js" as="script"><link rel="preload" href="/d2-crud-plus/assets/js/2.40e3d83c.js" as="script"><link rel="preload" href="/d2-crud-plus/assets/js/7.20165752.js" as="script"><link rel="preload" href="/d2-crud-plus/assets/js/76.cdad6b31.js" as="script"><link rel="prefetch" href="/d2-crud-plus/assets/js/10.df64ceb4.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/100.1b960036.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/101.0e6b7c65.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/102.60335619.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/11.d9cc7359.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/12.1fe853d9.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/13.beccd8a2.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/14.a22b7450.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/15.bfbc8e57.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/16.829da345.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/17.320c2a84.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/18.1ae2555c.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/19.dd1cfb7c.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/20.9f88070e.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/21.b4e311e8.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/22.508bfd88.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/23.d99910ba.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/24.3aac1d86.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/25.7f84d66c.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/26.010188d3.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/27.7ffcde1a.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/28.e5718534.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/29.a664aead.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/3.020e8c98.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/30.b5af54a5.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/31.3ce7cf81.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/32.74db3cbf.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/33.4afafef0.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/34.802ed380.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/35.829671b1.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/36.d62ff643.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/37.56355919.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/38.ef3567a6.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/39.f5bd440b.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/4.c9f444e5.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/40.097677b2.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/41.a1bdd4d7.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/42.d7c95839.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/43.ff1defe3.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/44.d08c49cd.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/45.15500c6e.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/46.49432e0a.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/47.4c86a170.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/48.9fb26f3b.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/49.2f1d3b4c.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/5.0c166f17.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/50.8adcf1fc.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/51.9debc188.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/52.b337fe05.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/53.1b4c4595.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/54.60ad5592.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/55.1ead7a60.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/56.4b4068b5.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/57.39b9a334.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/58.e342a69f.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/59.9286ee5c.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/6.dc3cf8b6.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/60.fca56e66.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/61.e53daf76.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/62.afa730c3.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/63.515344c7.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/64.5ea21d7e.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/65.5736928f.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/66.354c4f97.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/67.e458985d.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/68.9cf2e48e.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/69.afff9087.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/70.5f510366.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/71.08e285c9.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/72.fbdbf96d.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/73.4c7255c5.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/74.dbca5940.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/75.3cdd0828.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/77.f79386ae.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/78.885784bf.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/79.90e30120.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/8.ce580690.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/80.2b6522e0.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/81.ab19ef97.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/82.cb46f8f4.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/83.67a48600.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/84.224a00c3.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/85.e4002b19.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/86.e1acfe7c.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/87.263718a8.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/88.4548fddc.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/89.dcd81e26.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/9.18394d2c.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/90.70193895.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/91.60784f38.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/92.82037907.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/93.f7bbaf29.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/94.bfb96693.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/95.27670bd5.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/96.068d6ad1.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/97.d82da56e.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/98.20649291.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/99.74bab3f4.js">
    <link rel="stylesheet" href="/d2-crud-plus/assets/css/0.styles.04fdeb33.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/d2-crud-plus/" class="home-link router-link-active"><!----> <span class="site-name">d2-crud-plus</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/d2-crud-plus/guide/" class="nav-link router-link-active">
  指南
</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="更多" class="dropdown-title"><span class="title">更多</span> <span class="arrow down"></span></button> <button type="button" aria-label="更多" class="mobile-dropdown-title"><span class="title">更多</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><h4>
          核心
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/d2-crud-plus/d2-crud-x/" class="nav-link">
  D2-CRUD-X
</a></li></ul></li><li class="dropdown-item"><h4>
          周边项目
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="https://gitee.com/greper/d2-crud-plus" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Gitee镜像
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-subitem"><a href="https://github.com/greper/d2-crud-plus-with-d2admin-starter" target="_blank" rel="noopener noreferrer" class="nav-link external">
  精简启动项目
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-subitem"><a href="https://gitee.com/greper/d2-crud-plus-with-d2admin-starter" target="_blank" rel="noopener noreferrer" class="nav-link external">
  精简启动项目[gitee]
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-subitem"><a href="https://github.com/greper/d2-crud-plus-with-d2admin-starter/tree/permission" target="_blank" rel="noopener noreferrer" class="nav-link external">
  精简启动项目-带权限
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-subitem"><a href="https://gitee.com/greper/d2-crud-plus-with-d2admin-starter/tree/permission" target="_blank" rel="noopener noreferrer" class="nav-link external">
  精简启动项目-带权限[gitee]
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-subitem"><a href="https://github.com/greper/d2-crud-plus-server" target="_blank" rel="noopener noreferrer" class="nav-link external">
  配套java后端
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-subitem"><a href="https://gitee.com/greper/d2-crud-plus-server" target="_blank" rel="noopener noreferrer" class="nav-link external">
  配套java后端[gitee]
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></li><li class="dropdown-item"><h4>
          附加
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/d2-crud-plus/guide/permission.html" class="nav-link">
  权限管理
</a></li><li class="dropdown-subitem"><a href="/d2-crud-plus/guide/generate.html" class="nav-link">
  代码生成
</a></li></ul></li><li class="dropdown-item"><h4>
          衍生项目
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="https://cloud.battcn.com/#/index" target="_blank" rel="noopener noreferrer" class="nav-link external">
  后台获取配置的CRUD
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></li><li class="dropdown-item"><h4>
          友情链接
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="https://gitee.com/docmirror/dev-sidecar" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Github加速工具
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></li></ul></div></div><div class="nav-item"><a href="http://preview.d2-crud-plus.docmirror.cn/D2CrudPlusExample/index.html" target="_blank" rel="noopener noreferrer" class="nav-link external">
  演示
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <a href="https://github.com/greper/d2-crud-plus" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/d2-crud-plus/guide/" class="nav-link router-link-active">
  指南
</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="更多" class="dropdown-title"><span class="title">更多</span> <span class="arrow down"></span></button> <button type="button" aria-label="更多" class="mobile-dropdown-title"><span class="title">更多</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><h4>
          核心
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/d2-crud-plus/d2-crud-x/" class="nav-link">
  D2-CRUD-X
</a></li></ul></li><li class="dropdown-item"><h4>
          周边项目
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="https://gitee.com/greper/d2-crud-plus" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Gitee镜像
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-subitem"><a href="https://github.com/greper/d2-crud-plus-with-d2admin-starter" target="_blank" rel="noopener noreferrer" class="nav-link external">
  精简启动项目
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-subitem"><a href="https://gitee.com/greper/d2-crud-plus-with-d2admin-starter" target="_blank" rel="noopener noreferrer" class="nav-link external">
  精简启动项目[gitee]
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-subitem"><a href="https://github.com/greper/d2-crud-plus-with-d2admin-starter/tree/permission" target="_blank" rel="noopener noreferrer" class="nav-link external">
  精简启动项目-带权限
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-subitem"><a href="https://gitee.com/greper/d2-crud-plus-with-d2admin-starter/tree/permission" target="_blank" rel="noopener noreferrer" class="nav-link external">
  精简启动项目-带权限[gitee]
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-subitem"><a href="https://github.com/greper/d2-crud-plus-server" target="_blank" rel="noopener noreferrer" class="nav-link external">
  配套java后端
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-subitem"><a href="https://gitee.com/greper/d2-crud-plus-server" target="_blank" rel="noopener noreferrer" class="nav-link external">
  配套java后端[gitee]
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></li><li class="dropdown-item"><h4>
          附加
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/d2-crud-plus/guide/permission.html" class="nav-link">
  权限管理
</a></li><li class="dropdown-subitem"><a href="/d2-crud-plus/guide/generate.html" class="nav-link">
  代码生成
</a></li></ul></li><li class="dropdown-item"><h4>
          衍生项目
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="https://cloud.battcn.com/#/index" target="_blank" rel="noopener noreferrer" class="nav-link external">
  后台获取配置的CRUD
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></li><li class="dropdown-item"><h4>
          友情链接
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="https://gitee.com/docmirror/dev-sidecar" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Github加速工具
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></li></ul></div></div><div class="nav-item"><a href="http://preview.d2-crud-plus.docmirror.cn/D2CrudPlusExample/index.html" target="_blank" rel="noopener noreferrer" class="nav-link external">
  演示
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <a href="https://github.com/greper/d2-crud-plus" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav> <div style="padding:20px 30px  0px 30px;"><a target="_blank" href="https://www.aliyun.com/minisite/goods?userCode=qya11txb" style="width:100%"><img src="https://img.alicdn.com/tfs/TB1qnR3R1L2gK0jSZFmXXc7iXXa-440-240.jpg" style="width:100%"></a></div> <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>指南</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/d2-crud-plus/guide/" aria-current="page" class="sidebar-link">介绍</a></li><li><a href="/d2-crud-plus/guide/quickstart.html" class="sidebar-link">快速上手</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>进阶</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/d2-crud-plus/guide/mixins.html" class="sidebar-link">核心逻辑</a></li><li><a href="/d2-crud-plus/guide/structure.html" class="sidebar-link">数据结构</a></li><li><a href="/d2-crud-plus/guide/column-type.html" class="sidebar-link">字段类型</a></li><li><a href="/d2-crud-plus/guide/types.html" class="sidebar-link">字段类型列表</a></li><li><a href="/d2-crud-plus/guide/custom-type.html" class="sidebar-link">自定义字段类型</a></li><li><a href="/d2-crud-plus/guide/component.html" class="sidebar-link">组件配置</a></li><li><a href="/d2-crud-plus/guide/slot.html" class="sidebar-link">slot自定义</a></li><li><a href="/d2-crud-plus/guide/extends.html" class="sidebar-link">自定义扩展</a></li><li><a href="/d2-crud-plus/guide/dict.html" class="sidebar-link">数据字典</a></li><li><a href="/d2-crud-plus/guide/nest-data.html" class="sidebar-link">多级数据</a></li><li><a href="/d2-crud-plus/guide/flat-data.html" class="sidebar-link">数据扁平化</a></li><li><a href="/d2-crud-plus/guide/data-export.html" class="sidebar-link">数据导出</a></li><li><a href="/d2-crud-plus/guide/line-edit.html" class="sidebar-link">行编辑</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>API</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/d2-crud-plus/guide/options.html" class="sidebar-link">crud配置项</a></li><li><a href="/d2-crud-plus/guide/expose.html" aria-current="page" class="active sidebar-link">暴露的方法</a></li><li><section class="sidebar-group collapsable is-sub-group depth-1"><p class="sidebar-heading"><span>扩展</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable is-sub-group depth-1"><p class="sidebar-heading"><span>组件</span> <span class="arrow right"></span></p> <!----></section></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>附加功能</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/d2-crud-plus/guide/permission.html" class="sidebar-link">权限管理</a></li><li><a href="/d2-crud-plus/guide/generate.html" class="sidebar-link">代码生成</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>更多帮助</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/d2-crud-plus/guide/upgrade.html" class="sidebar-link">版本升级</a></li><li><a href="/d2-crud-plus/guide/breakingchange.html" class="sidebar-link">破坏性变更</a></li><li><a href="/d2-crud-plus/guide/upgradechange.html" class="sidebar-link">版本变更说明</a></li><li><a href="/d2-crud-plus/guide/questions.html" class="sidebar-link">常见问题</a></li><li><a href="/d2-crud-plus/guide/contact.html" class="sidebar-link">联系作者</a></li><li><a href="/d2-crud-plus/guide/donate.html" class="sidebar-link">捐赠</a></li><li><a href="/d2-crud-plus/guide/users.html" class="sidebar-link">他们在用</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>ChangeLog</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/d2-crud-plus/guide/changelogs/packages/d2-crud-x/CHANGELOG.html" class="sidebar-link">d2-crud-x</a></li><li><a href="/d2-crud-plus/guide/changelogs/packages/d2-crud-plus/CHANGELOG.html" class="sidebar-link">d2-crud-plus</a></li><li><a href="/d2-crud-plus/guide/changelogs/packages/d2-crud-plus-extends/CHANGELOG.html" class="sidebar-link">d2-crud-plus-extends</a></li><li><a href="/d2-crud-plus/guide/changelogs/packages/d2-crud-plus-example/CHANGELOG.html" class="sidebar-link">d2-crud-plus-example</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="暴露的方法"><a href="#暴露的方法" class="header-anchor">#</a> 暴露的方法</h1> <p>crud页面混入<code>d2CrudPlus.crud</code>后将会暴露以下方法<br>
以下方法可以根据你的实际情况通过<code>this.xxx() 来调用他们</code>或者在页面的methods中<code>覆盖重写</code></p> <div class="language-js extra-class"><pre class="language-js"><code><span class="token keyword">import</span> DictUtil <span class="token keyword">from</span> <span class="token string">'../utils/util.dicts'</span>
<span class="token keyword">import</span> log <span class="token keyword">from</span> <span class="token string">'../utils/util.log'</span>
<span class="token comment">/**
 * 暴露的方法
 */</span>
<span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token punctuation">{</span>
  methods<span class="token punctuation">:</span> <span class="token punctuation">{</span>

    <span class="token comment">// --------------页面初始化方法，可以被覆盖--------------</span>
    <span class="token comment">/**
     * 页面初始化，在created中被调用
     * 必要时可以覆盖为空方法，将this._doStart()在mounted中调用，用于改变初始化的时机
     * @private
     */</span>
    <span class="token function">_OnCreated</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">_doStart</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 重新加载新配置，可以动态修改任意配置内容，比如增删列
     */</span>
    <span class="token comment">// this.reInitColumns(crudOptions)</span>
    <span class="token comment">/**
     *  // 如果需要重复init，需要做一些清理工作
     * @private
     */</span>
    <span class="token function">initBefore</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">this</span><span class="token punctuation">.</span>crud<span class="token punctuation">.</span>addRules <span class="token operator">=</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>
      <span class="token keyword">this</span><span class="token punctuation">.</span>crud<span class="token punctuation">.</span>addTemplate <span class="token operator">=</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>
      <span class="token keyword">this</span><span class="token punctuation">.</span>crud<span class="token punctuation">.</span>editRules <span class="token operator">=</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>
      <span class="token keyword">this</span><span class="token punctuation">.</span>crud<span class="token punctuation">.</span>editTemplate <span class="token operator">=</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>
      <span class="token keyword">this</span><span class="token punctuation">.</span>crud<span class="token punctuation">.</span>viewTemplate <span class="token operator">=</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>
      <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span>crud<span class="token punctuation">.</span>searchOptions<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">this</span><span class="token punctuation">.</span>crud<span class="token punctuation">.</span>searchOptions<span class="token punctuation">.</span>columns <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
      <span class="token punctuation">}</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 初始化column前调用
     * 适合于当你想要给每个字段设置相同的属性时
     * 比如想要给所有的字段设置服务端排序：column.sortable='custom'
     * @param item
     */</span>
    <span class="token function">initColumnBefore</span> <span class="token punctuation">(</span><span class="token parameter">column</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>

    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token comment">/**
     * initColumns 初始化结束后调用方法
     *
     * 初始化完成后，会生成crud-x需要的最终配置
     * http://d2-crud-plus.docmirror.cn/d2-crud-plus/guide/mixins.html#_1-简化前的配置
     *
     * 如果需要动态修改列，可以在此处修改
     */</span>
    <span class="token function">initAfter</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 第一次请求页面数据
     * initColumns初始化完成后调用
     * 可以用一个空方法覆盖它，阻止初始化后请求数据
     */</span>
    <span class="token function">doLoad</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">return</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">doRefresh</span><span class="token punctuation">(</span><span class="token punctuation">{</span> <span class="token keyword">from</span><span class="token punctuation">:</span> <span class="token string">'load'</span> <span class="token punctuation">}</span><span class="token punctuation">)</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">// --------------以下方法，可以被调用，请注意不要覆盖--------------</span>
    <span class="token comment">/**
     * 获取D2CrudX的实例
     * 之后可以调用它暴露的方法
     * @returns
     */</span>
    <span class="token function">getD2Crud</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">const</span> ref <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span>$refs<span class="token punctuation">[</span><span class="token keyword">this</span><span class="token punctuation">.</span>crud<span class="token punctuation">.</span>format<span class="token punctuation">.</span>ref<span class="token punctuation">.</span>d2Crud<span class="token punctuation">]</span>
      <span class="token keyword">if</span> <span class="token punctuation">(</span>ref <span class="token operator">==</span> <span class="token keyword">null</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        log<span class="token punctuation">.</span><span class="token function">warn</span><span class="token punctuation">(</span><span class="token string">'d2Crud还未初始化，请在mounted之后调用此方法'</span><span class="token punctuation">)</span>
      <span class="token punctuation">}</span>
      <span class="token keyword">return</span> ref
    <span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     *  获取 el-table实例
     * @returns {*}
     */</span>
    <span class="token function">getD2CrudTable</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">const</span> ref <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">getD2Crud</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span>$refs<span class="token punctuation">.</span>elTable
      <span class="token keyword">if</span> <span class="token punctuation">(</span>ref <span class="token operator">==</span> <span class="token keyword">null</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        log<span class="token punctuation">.</span><span class="token function">warn</span><span class="token punctuation">(</span><span class="token string">'el-table还未初始化，请在mounted之后调用此方法'</span><span class="token punctuation">)</span>
      <span class="token punctuation">}</span>
      <span class="token keyword">return</span> ref
    <span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 获取当前列表数据
     * @returns
     */</span>
    <span class="token function">getD2CrudTableData</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">const</span> d2Crud <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">getD2Crud</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
      <span class="token keyword">return</span> d2Crud <span class="token operator">==</span> <span class="token keyword">null</span> <span class="token operator">||</span> d2Crud<span class="token punctuation">.</span>d2CrudData
    <span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 动态设置列表数据
     * @param data
     */</span>
    <span class="token function">setD2CrudTableData</span> <span class="token punctuation">(</span><span class="token parameter">data</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">this</span><span class="token punctuation">.</span>$<span class="token keyword">set</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">getD2Crud</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token string">'d2CrudData'</span><span class="token punctuation">,</span> data<span class="token punctuation">)</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 获取编辑框的formData
     * 仅在编辑对话框打开的情况下可用
     * @returns
     */</span>
    <span class="token function">getEditForm</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">return</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">getD2Crud</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span>formData
    <span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 获取编辑框打开时，当前行的数据
     * 仅在编辑对话框打开的情况下可用
     */</span>
    <span class="token function">getEditRow</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">return</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">getD2Crud</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span>formDataStorage
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token comment">/**
     * 获取编辑框的模式[view,edit,add]
     * 仅在编辑对话框打开的情况下可用
     * @returns
     */</span>
    <span class="token function">getEditFormMode</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">return</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">getD2Crud</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span>formMode
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token comment">/**
     * 获取编辑框的组件参数配置
     * 仅在编辑对话框打开的情况下可用
     * 可以进行动态修改
     * groupKey可不传
     * @returns
     */</span>
    <span class="token function">getEditFormTemplate</span> <span class="token punctuation">(</span><span class="token parameter">key<span class="token punctuation">,</span> groupKey</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">return</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">getD2Crud</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">getFormTemplate</span><span class="token punctuation">(</span>key<span class="token punctuation">,</span> groupKey<span class="token punctuation">)</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token comment">/**
     * 获取编辑框的分组组件参数配置
     * 仅在编辑对话框打开的情况下可用
     * @returns
     */</span>
    <span class="token function">getEditFormTemplateGroup</span> <span class="token punctuation">(</span><span class="token parameter">groupKey<span class="token punctuation">,</span> key</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">return</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">getD2Crud</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">getFormTemplateGroup</span><span class="token punctuation">(</span>groupKey<span class="token punctuation">,</span> key<span class="token punctuation">)</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 获取字典数据,可以传入列的key获取列中配置的dict
     * @param dict  [Object:dict配置 | string:列的key]
     * @param options Object {returnType: 'data'} 返回类型 可选值[data,dataMap]
     * @returns {Promise&lt;T&gt;}  异步返回promise
     */</span>
    <span class="token function">getDictData</span> <span class="token punctuation">(</span><span class="token parameter">dict<span class="token punctuation">,</span> options</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token keyword">typeof</span> dict <span class="token operator">===</span> <span class="token string">'string'</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token comment">// 获取某个字段中配置的dict的data</span>
        dict <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span>crud<span class="token punctuation">.</span>columnsMap<span class="token punctuation">[</span>dict<span class="token punctuation">]</span><span class="token punctuation">.</span>dict
      <span class="token punctuation">}</span>
      <span class="token comment">// 根据dict 获取字典数据</span>
      DictUtil<span class="token punctuation">.</span><span class="token function">mergeDefault</span><span class="token punctuation">(</span>dict<span class="token punctuation">)</span>
      <span class="token keyword">return</span> DictUtil<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span>dict<span class="token punctuation">,</span> options<span class="token punctuation">)</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 获取表单组件ref
     * @param key
     * @returns {undefined}
     */</span>
    <span class="token function">getFormComponentRef</span> <span class="token punctuation">(</span><span class="token parameter">key</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">const</span> refs <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">getD2Crud</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span>$refs<span class="token punctuation">[</span><span class="token string">'form_item_'</span> <span class="token operator">+</span> key<span class="token punctuation">]</span>
      <span class="token keyword">if</span> <span class="token punctuation">(</span>refs <span class="token operator">==</span> <span class="token keyword">null</span> <span class="token operator">||</span> refs<span class="token punctuation">.</span>length <span class="token operator">===</span> <span class="token number">0</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        log<span class="token punctuation">.</span><span class="token function">warn</span><span class="token punctuation">(</span><span class="token string">'该字段组件还未初始化，或者已被禁用'</span><span class="token punctuation">)</span>
        <span class="token keyword">return</span>
      <span class="token punctuation">}</span>
      <span class="token keyword">return</span> refs<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">getComponentRef</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 翻页
     * no=页码
     */</span>
    <span class="token comment">// this.doPageTurn (no){}</span>

    <span class="token comment">/**
     * 刷新页面
     */</span>
    <span class="token comment">// this.doRefresh (){}</span>

    <span class="token comment">/**
     * 主动查询
     * form = 查询参数
     */</span>
    <span class="token function">doSearch</span> <span class="token punctuation">(</span><span class="token parameter">form</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">handleSearch</span><span class="token punctuation">(</span>form<span class="token punctuation">)</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 获取search组件ref
     * @returns {*}
     */</span>
    <span class="token function">getSearch</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">return</span> <span class="token keyword">this</span><span class="token punctuation">.</span>$refs<span class="token punctuation">[</span><span class="token keyword">this</span><span class="token punctuation">.</span>crud<span class="token punctuation">.</span>format<span class="token punctuation">.</span>ref<span class="token punctuation">.</span>search<span class="token punctuation">]</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 获取search form 数据
     */</span>
    <span class="token comment">// this.getSearch().getForm()</span>

    <span class="token comment">/**
     *  触发search组件的查询按钮点击，能够获取search组件当前的form表单值进行查询
     */</span>
    <span class="token comment">// this.getSearch().doSearch()</span>

    <span class="token comment">// --------------以下是crud暴露的方法，可以修改列表中的数据等--------------</span>
    <span class="token comment">/**
     * 外部暴露的更新单元格数据方法
     */</span>
    <span class="token comment">// this.getD2Crud().updateCell(rowIndex, key, value)</span>

    <span class="token comment">/**
     * 外部暴露的新增行方法
     */</span>
    <span class="token comment">// this.getD2Crud().addRow(row)</span>

    <span class="token comment">/**
     * 外部暴露的编辑行方法
     */</span>
    <span class="token comment">// this.getD2Crud().handleUpdateRow(index, row)</span>

    <span class="token comment">/**
     * 外部暴露的删除行方法
     */</span>
    <span class="token comment">// this.getD2Crud().removeRow(index)</span>

    <span class="token comment">/**
     * 外部暴露的激活行内编辑
     */</span>
    <span class="token comment">// this.getD2Crud().handleLineEdit(index,row)</span>
    <span class="token comment">/**
     * 外部暴露的取消行内编辑
     */</span>
    <span class="token comment">// this.getD2Crud().handleLineEditCancel(index,row)</span>
    <span class="token comment">/**
     * 外部暴露的保存行内编辑
     */</span>
    <span class="token comment">// this.getD2Crud().handleLineEditSave(index,row)</span>

    <span class="token comment">/**
     * 外部暴露的打开模态框方法
     */</span>
    <span class="token comment">// this.getD2Crud().showDialog({</span>
    <span class="token comment">//   mode='view', //当前打开模式,可选项[add,edit,view]</span>
    <span class="token comment">//   rowIndex = 0, //编辑或查看时，哪一行的数据</span>
    <span class="token comment">//   template = null, //表单模版</span>
    <span class="token comment">//   addData = null //添加时的默认数据</span>
    <span class="token comment">//   modeContext= null //打开对话框的上下文参数，在updateRequest addRequest时会带上，可以根据不同的参数做不同的处理</span>
    <span class="token comment">//      对话框打开期间，可以通过this.getD2Crud().formModeContext 获取和修改modeContext的数据</span>
    <span class="token comment">// })</span>

    <span class="token comment">/**
     * 外部暴露的关闭模态框方法
     */</span>
    <span class="token comment">// this.getD2Crud().closeDialog()</span>

    <span class="token comment">// --------------以下方法，可以被覆盖重写--------------</span>

    <span class="token comment">/**
     * doRefresh结束后的操作
     */</span>
    <span class="token function">doAfterRefresh</span> <span class="token punctuation">(</span><span class="token parameter">query<span class="token punctuation">,</span> options</span><span class="token punctuation">)</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 对话框打开前被调用
     * 此方法内无法执行 getEditFormTemplate，请写到doDialogOpened
     * @param context
     * @private
     */</span>
    <span class="token function">doDialogOpen</span> <span class="token punctuation">(</span><span class="token parameter">context</span><span class="token punctuation">)</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 对话框关闭事件，包括保存时关闭和取消关闭
     * @param context
     */</span>
    <span class="token function">doDialogClosed</span> <span class="token punctuation">(</span><span class="token parameter">context</span><span class="token punctuation">)</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token comment">/***
     * 对话框打开后被调用（注意：此时组件还没有被mounted）
     * 可以设置一些默认值，或者做一些动态修改的工作
     * @param context :{
          mode: this.formMode,
          row: newRow,
          form: formData,
          template: this.formTemplateStorage,
          groupTemplate: this.formTemplateGroupStorage
      }
     */</span>
    <span class="token function">doDialogOpened</span> <span class="token punctuation">(</span><span class="token parameter">context</span><span class="token punctuation">)</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 编辑对话框取消
     * @param done
     */</span>
    <span class="token function">doDialogCancel</span> <span class="token punctuation">(</span><span class="token parameter">done</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token function">done</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token comment">// 必须调用，否则无法关闭对话框</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 多选change事件
     * @param selection
     */</span>
    <span class="token function">doSelectionChange</span> <span class="token punctuation">(</span><span class="token parameter">selection</span><span class="token punctuation">)</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 单选change事件
     */</span>
    <span class="token function">doCurrentChange</span> <span class="token punctuation">(</span><span class="token parameter">currentRow<span class="token punctuation">,</span> oldCurrentRow</span><span class="token punctuation">)</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 全选change事件
     * @param event
     */</span>
    <span class="token function">doSelectAll</span> <span class="token punctuation">(</span><span class="token parameter">event</span><span class="token punctuation">)</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 添加数据提交前可以进行修改
     * @param row
     */</span>
    <span class="token function">addBefore</span> <span class="token punctuation">(</span><span class="token parameter">row</span><span class="token punctuation">)</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 添加成功提示
     * @param row
     */</span>
    <span class="token function">showAddMessage</span> <span class="token punctuation">(</span><span class="token parameter"><span class="token punctuation">{</span> row <span class="token punctuation">}</span></span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">$message</span><span class="token punctuation">(</span><span class="token punctuation">{</span> message<span class="token punctuation">:</span> <span class="token string">'保存成功'</span><span class="token punctuation">,</span> type<span class="token punctuation">:</span> <span class="token string">'success'</span> <span class="token punctuation">}</span><span class="token punctuation">)</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 添加成功后触发
     * @param row
     */</span>
    <span class="token function">addAfter</span> <span class="token punctuation">(</span><span class="token parameter">row</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">doAfterRowChange</span><span class="token punctuation">(</span>row<span class="token punctuation">)</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 修改数据提交前可以进行修改
     * @param row
     */</span>
    <span class="token function">editBefore</span> <span class="token punctuation">(</span><span class="token parameter">row</span><span class="token punctuation">)</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 显示修改成功的提示
     * @param index
     * @param row
     */</span>
    <span class="token function">showEditMessage</span> <span class="token punctuation">(</span><span class="token parameter"><span class="token punctuation">{</span> index<span class="token punctuation">,</span> row <span class="token punctuation">}</span></span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">$message</span><span class="token punctuation">(</span><span class="token punctuation">{</span> message<span class="token punctuation">:</span> <span class="token string">'保存成功'</span><span class="token punctuation">,</span> type<span class="token punctuation">:</span> <span class="token string">'success'</span> <span class="token punctuation">}</span><span class="token punctuation">)</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 修改成功后触发
     * @param row
     */</span>
    <span class="token function">editAfter</span> <span class="token punctuation">(</span><span class="token parameter">row</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">doAfterRowChange</span><span class="token punctuation">(</span>row<span class="token punctuation">)</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 修改前可以改变传入数据
     * @param row
     */</span>
    <span class="token function">delBefore</span> <span class="token punctuation">(</span><span class="token parameter">row</span><span class="token punctuation">)</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 显示删除成功提示
     */</span>
    <span class="token function">showRemoveMessage</span> <span class="token punctuation">(</span><span class="token parameter"><span class="token punctuation">{</span> index<span class="token punctuation">,</span> row <span class="token punctuation">}</span></span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">$message</span><span class="token punctuation">(</span><span class="token punctuation">{</span> message<span class="token punctuation">:</span> <span class="token string">'删除成功'</span><span class="token punctuation">,</span> type<span class="token punctuation">:</span> <span class="token string">'success'</span> <span class="token punctuation">}</span><span class="token punctuation">)</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 删除成功后触发
     * @param row
     */</span>
    <span class="token function">delAfter</span> <span class="token punctuation">(</span><span class="token parameter">row</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">doAfterRowChange</span><span class="token punctuation">(</span>row<span class="token punctuation">)</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 行变动之后触发
     * 添加、修改、删除之后触发
     * 默认触发刷新列表
     * @param row
     */</span>
    <span class="token function">doAfterRowChange</span> <span class="token punctuation">(</span><span class="token parameter">row</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">doRefresh</span><span class="token punctuation">(</span><span class="token punctuation">{</span> <span class="token keyword">from</span><span class="token punctuation">:</span> <span class="token string">'afterRowChange'</span> <span class="token punctuation">}</span><span class="token punctuation">)</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 用户可覆盖的cell value 改变事件
     * @param context
     */</span>
    <span class="token function">doCellDataChange</span> <span class="token punctuation">(</span><span class="token parameter">context</span><span class="token punctuation">)</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token comment">/**
     * 用户可覆盖的编辑框表单改变事件
     * @param key
     * @param value
     */</span>
    <span class="token function">doFormDataChange</span> <span class="token punctuation">(</span><span class="token parameter"><span class="token punctuation">{</span> key<span class="token punctuation">,</span> value<span class="token punctuation">,</span> form <span class="token punctuation">}</span></span><span class="token punctuation">)</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 搜索框内组件value变化事件
     * @param key
     * @param value
     * @param component
     * @param form
     */</span>
    <span class="token function">doSearchDataChange</span> <span class="token punctuation">(</span><span class="token parameter"><span class="token punctuation">{</span> key<span class="token punctuation">,</span> value<span class="token punctuation">,</span> component<span class="token punctuation">,</span> form <span class="token punctuation">}</span></span><span class="token punctuation">)</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 列设置修改后调用
     * @param columns
     */</span>
    <span class="token function">doColumnsFilterChanged</span> <span class="token punctuation">(</span><span class="token parameter">columns</span><span class="token punctuation">)</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 服务端导出数据
     * @param context={
          search: this.crud.searchOptions.form,
          columns: this.crud.columns,
          data: this.crud.list
     * }
     */</span>
    <span class="token function">doServerExport</span> <span class="token punctuation">(</span><span class="token parameter">context</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">$message</span><span class="token punctuation">(</span><span class="token string">'请覆盖“doServerExport (context) ”方法，window.open打开后端导出url'</span><span class="token punctuation">)</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     * 本地导出列参数格式化
     * @param context
     * @param columns
     * @returns {*}
     */</span>
    <span class="token function">doExportHeaderFormat</span> <span class="token punctuation">(</span><span class="token parameter">context<span class="token punctuation">,</span> columns</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">const</span> columnBuilder <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span>crud<span class="token punctuation">.</span>pageOptions<span class="token punctuation">.</span>export<span class="token punctuation">.</span>columnBuilder
      <span class="token keyword">return</span> columns<span class="token punctuation">.</span><span class="token function">map</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token parameter">col</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
        <span class="token keyword">const</span> colConfig <span class="token operator">=</span> <span class="token punctuation">{</span>
          label<span class="token punctuation">:</span> col<span class="token punctuation">.</span>title<span class="token punctuation">,</span>
          prop<span class="token punctuation">:</span> col<span class="token punctuation">.</span>key
        <span class="token punctuation">}</span>
        <span class="token keyword">if</span> <span class="token punctuation">(</span>columnBuilder<span class="token punctuation">)</span> <span class="token punctuation">{</span>
          <span class="token function">columnBuilder</span><span class="token punctuation">(</span>colConfig<span class="token punctuation">,</span> context<span class="token punctuation">)</span>
        <span class="token punctuation">}</span>
        <span class="token keyword">return</span> colConfig
      <span class="token punctuation">}</span><span class="token punctuation">)</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token comment">/**
     *  本地导出 数据格式化
     * @param context
     * @param list
     * @returns {*}
     */</span>
    <span class="token function">doExportDataFormat</span> <span class="token punctuation">(</span><span class="token parameter">context<span class="token punctuation">,</span> list</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">const</span> formatter <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span>crud<span class="token punctuation">.</span>pageOptions<span class="token punctuation">.</span>export<span class="token punctuation">.</span>formatter
      <span class="token keyword">return</span> list<span class="token punctuation">.</span><span class="token function">map</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token parameter">row</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
        <span class="token keyword">if</span> <span class="token punctuation">(</span>formatter<span class="token punctuation">)</span> <span class="token punctuation">{</span>
          <span class="token function">formatter</span><span class="token punctuation">(</span>row<span class="token punctuation">,</span> context<span class="token punctuation">)</span>
        <span class="token punctuation">}</span>
        <span class="token keyword">return</span> row
      <span class="token punctuation">}</span><span class="token punctuation">)</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token comment">/**
     *  翻页变化事件,默认执行滚动条恢复到顶部
     * @param val
     */</span>
    <span class="token function">doPaginationChanged</span> <span class="token punctuation">(</span><span class="token parameter">val</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">try</span> <span class="token punctuation">{</span>
        <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">getD2CrudTable</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span>bodyWrapper<span class="token punctuation">.</span>scrollTop <span class="token operator">=</span> <span class="token number">0</span>
      <span class="token punctuation">}</span> <span class="token keyword">catch</span> <span class="token punctuation">(</span>e<span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><div class="custom-block warning"><p class="custom-block-title">WARNING</p> <p>注意不要覆盖<a href="https://gitee.com/greper/d2-crud-plus/blob/master/packages/d2-crud-plus/src/lib/mixins/crud.js" target="_blank" rel="noopener noreferrer">d2CrudPlus.crud<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>中未暴露的方法</p></div></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/greper/d2-crud-plus/edit/master//docs/guide/expose.md" target="_blank" rel="noopener noreferrer">在 GitHub 上编辑此页</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div> <div class="last-updated"><span class="prefix">上次更新:</span> <span class="time">2020/9/1 下午7:04:02</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/d2-crud-plus/guide/options.html" class="prev">
        crud配置项
      </a></span> <span class="next"><a href="/d2-crud-plus/guide/extends/area-selector.html">
        省市区选择组件
      </a>
      →
    </span></p></div> </main></div><div class="global-ui"></div></div>
    <script src="/d2-crud-plus/assets/js/app.cf559687.js" defer></script><script src="/d2-crud-plus/assets/js/2.40e3d83c.js" defer></script><script src="/d2-crud-plus/assets/js/7.20165752.js" defer></script><script src="/d2-crud-plus/assets/js/76.cdad6b31.js" defer></script>
  </body>
</html>
